Optimization and Evaluation of Nested Queries and Procedures

نویسنده

  • Ravindra Guravannavar
چکیده

Many database applications perform complex data retrieval and update tasks. Nested queries, and queries that invoke user-defined functions, which are written using a mix of procedural and SQL constructs, are often used in such applications. A straight-forward evaluation of such queries involves repeated execution of parameterized sub-queries or blocks containing queries and procedural code. An important problem that arises while optimizing nested queries as well as queries with joins, aggregates and set operations is the problem of finding an optimal sort order from a factorial number of possible sort orders. We show that even a special case of this problem is NP-Hard, and present practical heuristics that are effective and easy to incorporate in existing query optimizers. We also consider iterative execution of queries and updates inside complex procedural blocks such as user-defined functions and stored procedures. Parameter batching is an important means of improving performance as it enables set-orientated processing. The key challenge to parameter batching lies in rewriting a given procedure/function to process a batch of parameter values. We propose a solution, based on program analysis and rewrite rules, to automate the generation of batched forms of procedures and replace iterative database calls within imperative loops with a single call to the batched form. We present experimental results for the proposed techniques, and the results show significant gains in performance.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Optimizing Nested Queries with Parameter Sort Orders

Nested iteration is an important technique for query evaluation. It is the default way of executing nested subqueries in SQL. Although decorrelation often results in cheaper non-nested plans, decorrelation is not always applicable for nested subqueries. Nested iteration, if implemented properly, can also win over decorrelation for several classes of queries. Decorrelation is also hard to apply ...

متن کامل

Efficient Processing of Nested Fuzzy SQL Queries in a Fuzzy Database

ÐIn a fuzzy relational database where a relation is a fuzzy set of tuples and ill-known data are represented by possibility distributions, nested fuzzy queries can be expressed in the Fuzzy SQL language, as defined in [25], [23]. Although it provides a very convenient way for users to express complex queries, a nested fuzzy query may be very inefficient to process with the naive evaluation meth...

متن کامل

Nested Query Optimization in Relational Database

Many database applications perform complex data retrieval and update tasks. Nested queries, and queries that invoke user-defined functions, which are written using a mix of procedural and SQL constructs, are often used in such applications. A straight-forward evaluation of such queries involves repeated execution of parameterized sub-queries or blocks containing queries. This work discusses imp...

متن کامل

DATA ENGINEERII { G A publication of the IEEE Computer Society EEE TRANSACTIONS ON

ln a fuzzy relational database where a relation is atuzzy sel of tuples and ill-known data are represented by possibility distributions, nested fuzzy queries can be expressed in lhe Fuzzy SQL language, as defined in [25], [23]. Although it provides a very convenient way for users to express complex queries, a nested fuzzy query may be very inefficient to process with the naive evaluation method...

متن کامل

Nested Queries in Object Bases

Many declarative query languages for object oriented oo databases allow nested subqueries This paper contains the rst algebra which is capable of handling arbitrary nested queries and the rst complete classi cation of oo nested queries and the according unnesting strategies For unnesting a two phase approach is used The rst phase called dependency based optimization transforms queries at the qu...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • CoRR

دوره abs/0911.0508  شماره 

صفحات  -

تاریخ انتشار 2009